const path = require("path");
function resolve(dir) {
  return path.join(__dirname, dir);
}
//less文件的路径
const myTheme = path.resolve(__dirname, "./src/assets/less/vantChange.less");
//  创建路由别名
module.exports = {
  chainWebpack: config => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("assets", resolve("src/assets"))
      .set("components", resolve("src/components"))
      .set("base", resolve("baseConfig"))
      .set("public", resolve("public"));
  },
  css: {
    loaderOptions: {
        less: {
            modifyVars: {
                hack: `true; @import "${myTheme}";`
            }
        },
    }
  },
devServer :{
    proxy : 'http://localhost:8080'
}
  // devServer: {
  //   host: "localhost",
  //   port: 8080, // 端口号
  //   https: false, // https:{type:Boolean}
  //   open: true, 
  //   proxy: {
  //     '/' :{
  //       target:'http:localhost:8080',
  //       secure: false,
  //       changeOrigin:true,
  //       pathRewrite:{
  //         '^/':'/'
  //       }
  //     }
  //   }
  // },
}  

